//
//  EquipInfo.m
//  SpaceStorm
//
//  Created by 祥 雍 on 13-5-26.
//  Copyright (c) 2013年 __MyCompanyName__. All rights reserved.
//
//  装备表的信息类

#import "EquipInfo.h"
#import "Variable.h"

@implementation EquipInfo

@synthesize equipId = _equipId;
@synthesize equipBig = _equipBig;
@synthesize equipMid = _equipMid;
@synthesize equipSmall = _equipSmall;
@synthesize level = _level;
@synthesize groupId = _groupId;
@synthesize name = _name;
@synthesize flag = _flag;
@synthesize gold = _gold;
@synthesize buyGold = _buyGold;
@synthesize sellGold = _sellGold;
@synthesize equipValue = _equipValued;
@synthesize needSlot = _needSlot;
@synthesize type = _type;

@synthesize param1 = _param1;
@synthesize param2 = _param2;
@synthesize param3 = _param3;
@synthesize param4 = _param4;
@synthesize param5 = _param5;
@synthesize param6 = _param6;
@synthesize param7 = _param7;
@synthesize param8 = _param8;

@synthesize delayTime = _delayTime;
@synthesize actionId = _actionId;
@synthesize icon = _icon;
@synthesize modelId = _modelId;
@synthesize description = _description;
@synthesize BGDescription = _BGDescription;

+(id) infoWithTbxml:(TBXMLElement *)tbxml
{
    return [[[self alloc] initWithTbxml:tbxml] autorelease]; 
}


-(id) initWithTbxml:(TBXMLElement *)tbxml
{
    self = [super init]; 
	
	if (self!= nil) 
    {
        //装备id	
        self.equipId = [[TBXML valueOfAttributeNamed:@"id" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"装备id:%d", self.equipId);
        
        //装备大类	
        self.equipBig = [[TBXML valueOfAttributeNamed:@"equipBig" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"装备大类:%d", self.equipBig);
        
        //装备中类
        self.equipMid = [[TBXML valueOfAttributeNamed:@"equipMid" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"装备中类:%d", self.equipMid);
        
        //装备细类	
        self.equipSmall = [[TBXML valueOfAttributeNamed:@"equipSmall" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"装备细类:%d", self.equipSmall);
        
        //科技等级	
        self.level = [[TBXML valueOfAttributeNamed:@"level" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"科技等级:%d", self.level);
        
        //小组编号	
        self.groupId = [[TBXML valueOfAttributeNamed:@"groupId" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"小组编号:%d", self.groupId);
        
        //装备名	
        self.name = [TBXML valueOfAttributeNamed:@"name" forElement:tbxml];
        if(showXMLLog == YES) CCLOG(@"装备名:%@", self.name);
        
        //装备标志	
        self.flag = [[TBXML valueOfAttributeNamed:@"flag" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"装备标志:%d", self.flag);

        //金币	
        self.gold = [[TBXML valueOfAttributeNamed:@"gold" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"金币:%d", self.gold);
        
        //买入军费	
        self.buyGold = [[TBXML valueOfAttributeNamed:@"buyGold" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"买入军费:%d", self.buyGold);
        
        //卖出军费	
        self.sellGold = [[TBXML valueOfAttributeNamed:@"sellGold" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"卖出军费:%d", self.sellGold);
        
        //装配值	
        self.equipValue = [[TBXML valueOfAttributeNamed:@"equipValue" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"装配值:%d", self.equipValue);
        
        //所需槽位	
        self.needSlot = [[TBXML valueOfAttributeNamed:@"needSlot" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"所需槽位:%d", self.needSlot);
        
        //类型	
        self.type = [[TBXML valueOfAttributeNamed:@"type" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"类型:%d", self.type);
        
        //参数1功能	
        self.param1 = [[TBXML valueOfAttributeNamed:@"param1" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"参数1功能:%d", self.param1);

        //参数2功能	
        self.param2 = [[TBXML valueOfAttributeNamed:@"param2" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"参数2功能:%d", self.param2);
        
        //参数3功能	
        self.param3 = [[TBXML valueOfAttributeNamed:@"param3" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"参数3功能:%d", self.param3);
        
        //参数4功能	
        self.param4 = [[TBXML valueOfAttributeNamed:@"param4" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"参数4功能:%d", self.param4);
        
        //参数5功能	
        self.param5 = [[TBXML valueOfAttributeNamed:@"param5" forElement:tbxml] floatValue];
        if(showXMLLog == YES) CCLOG(@"参数5功能:%f", self.param5);
        
        //参数6功能	
        self.param6 = [[TBXML valueOfAttributeNamed:@"param6" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"参数6功能:%d", self.param6);
        
        //参数7功能	
        self.param7 = [[TBXML valueOfAttributeNamed:@"param7" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"参数7功能:%d", self.param7);
        
        //参数8功能	
        self.param8 = [[TBXML valueOfAttributeNamed:@"param8" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"参数8功能:%d", self.param8);
        
        //延迟启动时间	
        self.delayTime = [[TBXML valueOfAttributeNamed:@"delayTime" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"延迟启动时间:%d", self.delayTime);
        
        //装备AI脚本	
        self.actionId = [[TBXML valueOfAttributeNamed:@"actionId" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"装备AI脚本:%d", self.actionId);
        
        //图标	
        self.icon = [TBXML valueOfAttributeNamed:@"icon" forElement:tbxml];
        if(showXMLLog == YES) CCLOG(@"图标:%@", self.icon);
        
        //模型	
        self.modelId = [[TBXML valueOfAttributeNamed:@"modelId" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"模型:%d", self.modelId);
        
        //说明	
        self.description = [TBXML valueOfAttributeNamed:@"description" forElement:tbxml];
        if(showXMLLog == YES) CCLOG(@"说明:%@", self.description);
        
        //装备背景	
        self.BGDescription = [TBXML valueOfAttributeNamed:@"BGDescription" forElement:tbxml];
        if(showXMLLog == YES) CCLOG(@"装备背景:%@", self.BGDescription);
    }
    
    return self;
}


@end
